package system.student.mapper;



import org.apache.ibatis.annotations.Param;
import system.student.entity.Clazz;
import system.student.entity.Dept;
import system.student.annotate.LogRecord;
import system.student.entity.user.Teacher;

import java.util.List;


public interface TeacherMapper {

    /**
     * 注册
     * @param teacher
     */
    @LogRecord(
            module = "注册",
            operation = "老师用户注册",
            operatorType = "用户注册"
    )
    void register(Teacher teacher);

    /**
     * 根据用户id查询用户信息
     * @return
     */
    @LogRecord(
            module = "登录",
            operation = "老师用户注册",
            operatorType = "用户登录"
    )
    Teacher selectByUserId(Long id);

    List<Teacher> selectAllTeacher();

    List<Long> selectAllTeacherUserId();

    Integer selectStateByUserId(Long userId);

    void updateStateByUserId(@Param("newState")Integer newState,@Param("userId") Long userId);


    List<Teacher> selectAllTeacherId();

    List<Clazz> selectAllClassId();

    void insertTeacherIntoClass(@Param("teacherId")Long teacherId, @Param("classId")Long classId);

    List<Dept> selectAllDeptId();

    String selectById(Long deptId);

    void insertTeacherIntoDept(@Param("teacherId")Long teacherId,@Param("deptId") Long deptId, @Param("deptName")String deptName);
}
